package pro.cherish.apollo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pro.cherish.apollo.config.LocalProperties;

/**
 * @author 创建人：cherish
 * @version 版本号：V1.0
 * <p>
 * ***************************修订记录************************************
 * 2019-08-25 cherish 创建该类功能。
 * **********************************************************************
 * </p>
 * @ClassName 类名：TestController
 * @Description 功能说明：
 * <p>
 * TODO
 * </p>
 * **********************************************************************
 * @date 创建日期： 2019-08-25 cherish
 */
@RestController
public class TestController {
	@Value("${author:hehe}")
	private String author;

	@RequestMapping("/test")
	public String test01() {
		return author;
	}

	@Autowired
	private LocalProperties localProperties;

	@RequestMapping("/test2")
	public LocalProperties test02() {
		System.out.println(localProperties.getAddress());
		System.out.println(localProperties.getPort());
		System.out.println(localProperties.getStoragePath());
		System.out.println(localProperties);
		return localProperties;
	}
}
